package PapperTest.DuDu;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int m = scanner.nextInt();

        int oddIncrement = 0;
        int evenIncrement = 0;

        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }

        for (int i = 0; i < m; i++) {
            int t = scanner.nextInt();
            int x = scanner.nextInt();

            if (t == 1) {
                oddIncrement += x;
            } else if (t == 2) {
                evenIncrement += x;
            }
        }

        for (int i = 0; i < n; i++) {
            if (array[i] % 2 != 0) {
                array[i] += oddIncrement;
            } else {
                array[i] += evenIncrement;
            }
        }

        for (int i = 0; i < n - 1; i++) {
            System.out.print(array[i] + " ");
        }
        System.out.print(array[n - 1]);
        scanner.close();
    }

//    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        int x = scanner.nextInt();
//        int k = scanner.nextInt();
//        scanner.close();
//
//        Map<Integer, Integer> seen = new HashMap<>();
//        int step = 0;
//
//        while (step < k) {
//            if (seen.containsKey(x)) {
//                int cycleLength = step - seen.get(x);
//                int remainingSteps = (k - step) % cycleLength;
//                for (int i = 0; i < remainingSteps; i++) {
//                    x = transform(x);
//                }
//                System.out.println(x);
//                return;
//            }
//            seen.put(x, step);
//            x = transform(x);
//            step++;
//        }
//
//        System.out.println(x);
//    }
//
//    private static int transform(int x) {
//        String xStr = String.valueOf(x);
//        int n = xStr.length();
//        int newX = 0;
//
//        for (int i = 0; i < n; i++) {
//            int digit = xStr.charAt(i) - '0';
//            newX += Math.pow(digit, n - i);
//        }
//
//        return newX;
//    }
}

/*
5 3
1 2 3 4 5
1 2
2 2
1 3
*/